@extends('layout.admin_base')

@section('content')
	@parent
	<section class="content">
		<div class="box box-primary">
			<form method="post" action="">
				<div class="box-body">
					<input type="hidden" name="_method" value="put" />
					{!! csrf_field() !!}
                    @foreach($formItemList as $formItem)
                        @switch($formItem["control"])
                            @case("input")
                            <div class="form-group">
                                <label for="{{$formItem['field']}}">{{$formItem["name"]}}</label>
                                <input type="text" name="{{$formItem['field']}}" id="{{$formItem['field']}}" class="form-control" placeholder='请输入{{$formItem["name"]}}' value="{{old($formItem['field']) ? old($formItem['field']) : $info[$formItem['field']]}}">
                            </div>
                            @break
                            @case("select")
                            <div class="form-group">
                                <label for="{{$formItem['field']}}">{{$formItem["name"]}}</label>
                                <select class="form-control" id="{{$formItem['field']}}" name="{{$formItem['field']}}">
                                    @foreach( $formItem["options"] as $item)
                                    <option value="{{$item['value']}}" {{old($formItem['field']) ? (old($formItem['field']) == $item['value'] ? 'selected' : '') : ($info[$formItem['field']] == $item['value'] ? 'selected' : '')}}>{{$item['text']}}</option>
                                    @endforeach
                                </select>
                            </div>
                            @break
                        @endswitch
                    @endforeach
				</div>
				@include('layout.data_footer')
			</form>
    	</div>
	</section>
@endsection